/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package partnermanagement;

/**
 *
 * @author Home
 */
public class Eltern implements IEltern{

    protected String username;
    protected String vorname;
    protected String nachname;
    

    public Eltern(String Username, String Vorname, String Nachname) {
        super();
        this.username = Username;
        this.vorname = Vorname;
        this.nachname = Nachname;
    }





    /* (non-Javadoc)
	 * @see partnermanagement.IEltern#getUsername()
	 */
    @Override
	public String getUsername() {
		return username;
	}

	/* (non-Javadoc)
	 * @see partnermanagement.IEltern#setUsername(java.lang.String)
	 */
	@Override
	public void setUsername(String username) {
		this.username = username;
	}

	/* (non-Javadoc)
	 * @see partnermanagement.IEltern#getVorname()
	 */
	@Override
	public String getVorname() {
		return vorname;
	}

	/* (non-Javadoc)
	 * @see partnermanagement.IEltern#setVorname(java.lang.String)
	 */
	@Override
	public void setVorname(String vorname) {
		this.vorname = vorname;
	}

	/* (non-Javadoc)
	 * @see partnermanagement.IEltern#getNachname()
	 */
	@Override
	public String getNachname() {
		return nachname;
	}

	/* (non-Javadoc)
	 * @see partnermanagement.IEltern#setNachname(java.lang.String)
	 */
	@Override
	public void setNachname(String nachname) {
		this.nachname = nachname;
	}

    public boolean equals(Object eltern) {
    	if(eltern instanceof Eltern){
    		if(!((IEltern) eltern).getNachname().equals(this.getNachname())){
    			return (!((IEltern) eltern).getNachname().equals(this.getNachname()));
    		} else {
    			return (!((IEltern) eltern).getVorname().equals(this.getVorname()));
    		}
    	}
    	return false;
    }

    public int hashCode() {
        int hash = 7;
        hash = 97 * hash + (this.username != null ? this.username.hashCode() : 0);
        return hash;
    }
}
